/**
 *
 * @param array
 * @returns {Buffer | SharedArrayBuffer | any[] | BigUint64Array | Uint8ClampedArray | Uint32Array | Blob | Int16Array | Float64Array | string | Uint16Array | ArrayBuffer | Int32Array | Float32Array | BigInt64Array | Uint8Array | Int8Array}
 */
function shuffle(array){
  let arr = array.slice(0);
  for(let i = arr.length - 1; i > 0 ;i--){
      const randomIndex = Math.floor(Math.random() * i + 1);
      [arr[i],arr[randomIndex]] = [arr[randomIndex],arr[i]];
  }
  return arr
}
module.exports = shuffle;